<!-- @format -->

<template>
  <view class="easyClear">
    <child-header-bar
      :childTitle="childTitle"
      @getMarginTop="getMarginTop"></child-header-bar>
    <view class="easyClear-content" :style="[{ top: top + 'px' }]">
      <view class="conText" v-if="openid === '1'">
        <rich-text :nodes="agreement"></rich-text>
      </view>
      <view class="conText" v-if="openid === '2'">
        <rich-text :nodes="remark"></rich-text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      childTitle: '隐私协议',
      top: 68,
      // 用户
      agreement: '',
      // 商家
      remark: '',
      openid: '',
    }
  },
  onLoad() {
    this.getList()
    this.openid = uni.getStorageSync('openid')
  },

  methods: {
    // 动态接收导航栏高度
    getMarginTop(marginTop) {
      this.top = marginTop ? marginTop : 150
    },

    getList() {
      let _this = this
      uni.request({
        url: _this.$httpApi.install.searchList,
        method: 'GET',
        success: (res) => {
          console.log(res)
          _this.agreement = res.data.data.agreement
          _this.remark = res.data.data.remark
        },
      })
    },
  },
}
</script>

<style lang="scss" scoped>
.easyClear-content {
  position: absolute;
  padding: 33rpx 50rpx;
}

.conText {
  font-size: 28rpx;
  font-family: Source Han Sans CN, Source Han Sans CN;
  font-weight: 400;
  color: #595959;
}
</style>
